@import './variables';

// reset
* {
    box-sizing: border-box;
    outline: none;
}

html {
    font-size: 54px;
    width: 100%;
    height: 100%;

}

body {
    // height: 100%;
    width: 100%;
    margin: 0; 
    font-family: 'Microsoft YaHei','微软雅黑', Arial;
    background: #fff;
    -webkit-font-smoothing: antialiased;
}


ul {
    margin: 0;
}

li {
    list-style-type: none;
}

@each $colorKey,
$color in $colors {
    .text-#{$colorKey} {
        color: $color !important;
    }

    .bg-#{$colorKey} {
        background-color: $color;
    }
}

// text align
@each $var in (left, center, right, baseline) {
    .text-#{$var} {
        text-align: $var !important;
    }
}

@each $sizeKey,
$size in $font-sizes {
    .fs-#{$sizeKey} {
        font-size: $size !important;

    }
}

;

@each $key,
$value in $line-height {
    .lh-#{$key} {
        line-height: $value;
    }
}

;

@each $key,
$value in $position {
    .position-#{$key} {
        position: $value
    }
}

@each $key,
$value in $font-families {
    .ff-#{$key} {
        font-family: $value;
    }
}

;

@each $sizeKey,
$size in $font-weight {
    .fw-#{$sizeKey} {
        font-weight: $size;
    }
}

;

// text overflow
.text-ellipsis {
    display: inline-block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.text-wrap {
    display: inline-block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: wrap;
}

.ov {
    overflow: hidden;
}

// width, height
.w-100 {
    width: 100%;
}

.h-100 {
    height: 100%;
}

// flex
.d-flex {
    display: flex;
}

.flex-column {
    flex-direction: column;
}

.flex-wrap {
    flex-wrap: wrap;
}

flex-shrink .cursor-p {
    cursor: pointer;
}

@each $key,
$value in $flex-jc {
    .jc-#{$key} {
        justify-content: $value;
    }
}

@each $key,
$value in $flex-ai {
    .ai-#{$key} {
        align-items: $value;
    }
}

.flex-1 {
    flex: 1;
}

.flex-grow-1 {
    flex-grow: 1;
}

// m-0, mx-0
@each $typeKey,
$type in $spacing-types {

    // .m-1
    @each $sizeKey,
    $size in $spacing-sizes {
        .#{$typeKey}-#{$sizeKey} {
            #{$type}: $size;
        }
    }

    // .mx-1 , .my-1
    @each $sizeKey,
    $size in $spacing-sizes {
        .#{$typeKey}x-#{$sizeKey} {
            #{$type}-left: $size;
            #{$type}-right: $size;
        }

        .#{$typeKey}y-#{$sizeKey} {
            #{$type}-top: $size;
            #{$type}-bottom: $size;
        }
    }

    // .mt-1
    @each $directionKey,
    $direction in $spacing-directions {

        @each $sizeKey,
        $size in $spacing-sizes {
            .#{$typeKey}#{$directionKey}-#{$sizeKey} {
                #{$type}-#{$direction}: $size;
            }
        }
    }
}

// button
.my-btn {
    cursor: pointer;
    color: #fff;
    border: none;
    border-radius: 0.026rem;
    background: map-get($colors, '318');
    padding: 0.0521rem 0.2083rem;
    font-size: 0.0833rem;
    line-height: 0.0833rem;
}

// nav


// sprite


// borders
@each $dir in (top, right, bottom, left) {

    // .border-#{$dir} {
    //     border-#{$dir}: 1px solid $border-color;
    // }
    @each $colorKey,
    $color in $colors {
        .border-#{$dir}-#{$colorKey} {
            border-#{$dir}: 1px solid $color;
        }

        .border2-#{$dir}-#{$colorKey} {
            border-#{$dir}: 2px solid $color;
        }
    }
}